<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends BaseController {
    public function index(){
		//文章
		$article = D('article');
		$count = $article->count();
		$Page = new \Think\Page($count,7);// 实例化分页类 传入总记录数和每页显示的记录数(25)
		$Page->setConfig('prev','上一页');
		$Page->setConfig('next','下一页');
		$show = $Page->show();// 分页显示输出
		$articleRes = $article->limit($Page->firstRow.','.$Page->listRows)->select();//数据
		$this->page = $show;
		$this->article = $articleRes;
		$this->display();
    }
}